<template>
  <div class="my-header" :style="{backgroundColor:backgroundColor,color:color}"  >{{title}}</div>
</template>

<script>
export default {
  props:{
    title:String, //校验外面传入值得类型 
    backgroundColor: {
      type : String,
      required:true //要求backgroundColor变量必须传入一个值
    },
    color:{
      type : String,
      default: "#fff"
    }
  }



}
</script>

<style lang="less" scoped>
  .my-header {
    height: 45px;
    line-height: 45px;
    text-align: center;
    background-color: #1d7bff;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2;
  }
</style>